package com.example.payer.model

import com.example.common.view.model.BaseResultData
import com.example.payer.api.PayerApiServer
import com.example.payer.etity.Payer
import com.example.payer.etity.PayerEntity
import com.example.payer.etity.PostPayerEntity
import javax.inject.Inject

class PayerRepository @Inject constructor(private val apiServer: PayerApiServer):PayerApiServer {
    override suspend fun getPayer(payerId: Int): BaseResultData<List<Payer>> {
        return apiServer.getPayer(payerId)
    }

    override suspend fun getPayerDetail(id: Int): BaseResultData<Payer> {
        return apiServer.getPayerDetail(id)
    }

    override suspend fun postPayer(body: PostPayerEntity): BaseResultData<PostPayerEntity> {
        return apiServer.postPayer(body)
    }

    override suspend fun putPayer(id: Int, body: Payer): BaseResultData<Payer> {
        return apiServer.putPayer(id, body)
    }
}